<template>
	<el-drawer title="产业园区档案" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="园区名称" prop="name">{{form.name}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="总面积" prop="total_area">{{form.total_area}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="省" prop="province_id">{{form.province_id}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="租金定价（聚合）" prop="rental_pricing">{{form.rental_pricing}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="市" prop="city_id">{{form.city_id}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="物业费（聚合）" prop="strata_fees">{{form.strata_fees}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="区县" prop="district_id">{{form.district_id}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="企业数量（聚合）" prop="enterprises">{{form.enterprises}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="园区类别" prop="park_category">{{form.park_category}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="是否竞品" prop="competition">{{form.competition}}</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="产业定位" prop="industry_positioning">{{form.industry_positioning}}</el-form-item>
					<el-form-item label="园区介绍">
						<div v-html="form.introduce"></div>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu
	},
	data() {
		return {
			loading: false,
			form: {
				id:'',
				name:'',
				total_area: '',
				province_id: '',
				rental_pricing: '',
				city_id:"",
				strata_fees:"",
				district_id:'',
				enterprises:'',
				park_category: '',
				competition: '',
				industry_positioning:'',
				introduce:''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(){
			this.visible = true;
			return this;
		},
		async setData(data){
			console.log('setdata')
			let resProvinceName = await this.$API.attractinvestment.common.getCityNameById.get({id:data.province_id});
			let resCityName = await this.$API.attractinvestment.common.getCityNameById.get({id:data.city_id});
			let resDitrictName = await this.$API.attractinvestment.common.getCityNameById.get({id:data.district_id});

			this.form.id = data.id
			this.form.name = data.name
			this.form.total_area = data.total_area
			this.form.province_id = resProvinceName.data[0].city_name
			this.form.rental_pricing = data.rental_pricing
			this.form.city_id = resCityName.data[0].city_name
			this.form.strata_fees = data.strata_fees
			this.form.district_id = resDitrictName.data[0].city_name
			this.form.enterprises = data.enterprises
			this.form.park_category = data.park_category
			this.form.competition = data.competition
			this.form.industry_positioning = data.industry_positioning
			this.form.introduce = data.introduce
		},
		async getParkById(data)
		{
			console.log('getParkById')
			let res = await this.$API.attractinvestment.park.getParkById.get({id:data});
			{
				if(res.code==200)
				{
					let resProvinceName = await this.$API.attractinvestment.common.getCityNameById.get({id:res.data.province_id});
					let resCityName = await this.$API.attractinvestment.common.getCityNameById.get({id:res.data.city_id});
					let resDitrictName = await this.$API.attractinvestment.common.getCityNameById.get({id:res.data.district_id});

					this.form.id = res.data.id
					this.form.name = res.data.name
					this.form.total_area = res.data.total_area
					this.form.province_id = resProvinceName.data[0].city_name
					this.form.rental_pricing = res.data.rental_pricing
					this.form.city_id = resCityName.data[0].city_name
					this.form.strata_fees = res.data.strata_fees
					this.form.district_id = resDitrictName.data[0].city_name
					this.form.enterprises = res.data.enterprises
					this.form.park_category = res.data.park_category
					this.form.competition = res.data.competition
					this.form.industry_positioning = res.data.industry_positioning
					this.form.introduce = res.data.introduce
				}else
				{
					this.$alert(res.message, "提示", {type: 'error'})
				}
			}
		}
	}
}
</script>

<style>
</style>
